Skip to content

PostgreSQL - SQL error when add new tag#6314

Closed
alikon wants to merge 11 commits intojoomla:stagingfrom
alikon:patch-8
Closed

PostgreSQL - SQL error when add new tag#6314
alikon wants to merge 11 commits intojoomla:stagingfrom
alikon:patch-8

Conversation

@alikon
Copy link
Copy Markdown
Contributor

@alikon alikon commented Mar 5, 2015

Steps to reproduce the issue

go to the article manager and create a new article or edit an existing article In the tags field create a tag on the fly or in other words don´t select an existing tag but put in a new tag. Then hit the "Save".

Expected result

The article is saved with the new added tag

Actual result

the tag field is cleared and the article is not saved

System information

PostgreSQL 9.3.5
Joomla 3.4.0

Additional comments

As suggested added a sanity check for NOT NULL FIELDS
fix #6104

#### Steps to reproduce the issue
go to the article manager and create a new article or edit an existing article In the tags field create a tag on the fly or in other words don´t select an existing tag but put in a new tag. Then hit the "Save".

#### Expected result
The article is saved with the new added tag

#### Actual result 
the tag field is cleared and the article is not saved

#### System information
PostgreSQL 9.3.5
Joomla 3.4.0

#### Additional comments
As suggested added a sanity check for NOT NULL FIELDS
fix #6104
alikon added 2 commits March 5, 2015 08:13
whitespace at end of line
i hate whitespaces at end of line
@waader
Copy link
Copy Markdown
Contributor

waader commented Mar 5, 2015

@alikon Please try the following:

  • Add a new article with a title and fill in a new tag (= adhoc tag), then save. The article is saved.
  • Repeate the above step. You get the error message:

Save failed with the following error: SQL=INSERT INTO udzse_contentitem_tag_map

Another test case:

  • Add to an existing article two or more tags: only the first tag is saved.

Under mssql to get the following error when you try to add a new tag to an existing article:

Save failed with the following error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Error converting data type varchar to bigint.SQL=INSERT INTO ufv5y_tags VALUES ('1','1','17','18','2015-03-05-20-25-47','2015-03-05-20-25-47','Stiege','('''')','1','((0))','2015-03-05 20:25:47','1','{}',' ',' ','{}','((0))','2015-03-05 20:25:47','('''')','((0))','2015-03-05 20:25:47','{}','{}','((0))','*','((1))','2015-03-05 20:25:47','2015-03-05 20:25:47')

@alikon
Copy link
Copy Markdown
Contributor Author

alikon commented Mar 5, 2015

@waader
i'm experiencing the same issues on postgresql
where the driver return a bad default value for fields of type (TEXT, CHARACTER VARYING) declared NOT NULL WITH DEFAULT , for postgresql i have a fix ,
i guess for MSSQL the same reason
if you can help me on sqlsrv runnnig this query and report back the results

    SELECT column_name as Field, data_type as Type, is_nullable as \'Null\', column_default as \'Default\'
           FROM information_schema.columns WHERE table_name = #__tags

maybe i will able to find a fix to mssql too

@waader
Copy link
Copy Markdown
Contributor

waader commented Mar 6, 2015

@alikon I modified your sql slightly to

SELECT column_name as Field, data_type as Type, is_nullable as 'Null', column_default as 'Default'
FROM information_schema.columns WHERE table_name = 'aqmag_tags'

and this gives the following back:

id bigint NO NULL
parent_id bigint NO ((0))
lft int NO ((0))
rgt int NO ((0))
level bigint NO ((0))
path nvarchar NO ('')
title nvarchar NO NULL
alias nvarchar NO ('')
note nvarchar NO ('')
description nvarchar NO NULL
published smallint NO ((0))
checked_out bigint NO ((0))
checked_out_time datetime NO ('1900-01-01T00:00:00.000')
access bigint NO ((0))
params nvarchar NO NULL
metadesc nvarchar NO NULL
metakey nvarchar NO NULL
metadata nvarchar NO NULL
created_user_id bigint NO ((0))
created_time datetime NO ('1900-01-01T00:00:00.000')
created_by_alias nvarchar NO ('')
modified_user_id bigint NO ((0))
modified_time datetime NO ('1900-01-01T00:00:00.000')
images nvarchar NO NULL
urls nvarchar NO NULL
hits bigint NO ((0))
language nvarchar NO NULL
version bigint NO ((1))
publish_up datetime NO ('1900-01-01T00:00:00.000')
publish_down datetime NO ('1900-01-01T00:00:00.000')

@alikon
Copy link
Copy Markdown
Contributor Author

alikon commented Mar 6, 2015

@waader can you send the results in a more viewable (tabular/matrix) way even with screenshot I'm not sure I've fully understand the results

@waader
Copy link
Copy Markdown
Contributor

waader commented Mar 6, 2015

Of course:
j33_sql_tag

@alikon
Copy link
Copy Markdown
Contributor Author

alikon commented Mar 6, 2015

Thx now is clear, let me prepare a fix.....

alikon added 2 commits March 6, 2015 18:31
the postgresql driver return a "bad" default value for fields of type (TEXT, CHARACTER VARYING) declared NOT NULL WITH DEFAULT 
solve #6314
the mssql driver return a "bad" default value for fields of type nvarchar declared NOT NULL WITH DEFAULT
@alikon
Copy link
Copy Markdown
Contributor Author

alikon commented Mar 6, 2015

@waader
i'm not so confident with mssql is more diffcult blind code

@waader
Copy link
Copy Markdown
Contributor

waader commented Mar 6, 2015

@test works much better now, but there is one case I would like you to try:

  • add a new article and add three tags on the fly: test1, test2, test3
  • then hit save
  • only test1 gets saved
  • it is possible now to add further tags, but no more than one at a time

@alikon
Copy link
Copy Markdown
Contributor Author

alikon commented Mar 7, 2015

@waader
should be fixed now i've tested with 7 tags
can you confirm

@waader
Copy link
Copy Markdown
Contributor

waader commented Mar 14, 2015

@alikon works fine with postgresql now. Mssql is another chapter and not in the scope of this pr. Thanks!

@brianteeman
Copy link
Copy Markdown
Contributor

Confirmed issue
Confirmed PR resolved it


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6314.

@brianteeman
Copy link
Copy Markdown
Contributor

Two tests setting RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6314.

@brianteeman brianteeman added the RTC This Pull Request is Ready To Commit label May 23, 2015
@zero-24 zero-24 modified the milestone: Joomla! 3.4.4 Jul 2, 2015
@Kubik-Rubik
Copy link
Copy Markdown
Member

Thank you @alikon! Merged.

Bakual pushed a commit to Bakual/joomla-cms that referenced this pull request Aug 5, 2015
No need for a hackish workaround for an unused table column.
@Bakual Bakual mentioned this pull request Aug 5, 2015
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postgresql: tags created on the fly are not saved

6 participants